package com.example.service1.call.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect()
public class Service1Aop {
    @Pointcut(value = "bean(rpcController) && execution(* *(..))")
    public void pointcutRpc(){
    }

    @Pointcut(value = "bean(feignController) && execution(* *(..))")
    public void pointcutFeign(){
    }

    @Before("pointcutRpc()")
    public void rpcBeforeNotice(){
        System.out.println("rpc调用");
    }

    @Before("pointcutFeign()")
    public void feignBeforeNotice(){
        System.out.println("feign调用");
    }

}
